<%@ page language="java" import="java.util.*,com.entity.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'zdyryqk.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  <script>
function openwindow(str)
{
  window.open("doTree.jsp?sid="+str+"&pd=","部门","height=380,width=260,top=230,left=450,scrollbars=yes"); 
   //showModalDialog("doTree.jsp","部门","height=380,width=260,top=230,left=250,scrollbars=yes");
}
function yz(){
		
	 if(document.getElementById("startNl").value==""||document.getElementById("endNl").value==""||document.getElementById("nljg").value==""){alert("请输入年龄");
		return false;
		}else{
		self.parent.tb_remove();
		return true;
		}
	}
function yznl(falg){
	if(falg==1){
		if(isNaN(document.getElementById("startNl").value)==true)
		{
			alert("年龄必须是数字");
			document.getElementById("startNl").value="";
		}
	}
	if(falg==2){
		if(isNaN(document.getElementById("endNl").value)==true)
		{
			alert("年龄必须是数字");
			document.getElementById("endNl").value="";
			
		}
		if(parseInt(document.getElementById("endNl").value)<=parseInt(document.getElementById("startNl").value)){
			alert("终止年龄必须大于起始年龄");
			document.getElementById("endNl").value="";
		}
	}
	if(falg==3){
		if(isNaN(document.getElementById("nljg").value)==true)
		{
			alert("年龄必须是数字");
			document.getElementById("nljg").value="";
		}
		if(parseInt(document.getElementById("nljg").value)>parseInt(document.getElementById("endNl").value)){
			alert("年龄间隔必须小于终止年龄");
			document.getElementById("nljg").value="";
		}
	}
}
</script>

  <body onload="loaddw();selectedaddr()">
  <%Dlyh dlyh = (Dlyh)request.getSession().getAttribute("dlyh");  
  if((dlyh.getZd().getTypename().endsWith("乡")||dlyh.getZd().getTypename().equals("工业园区")||dlyh.getZd().getTypename().endsWith("镇")||dlyh.getZd().getTypename().endsWith("办")||dlyh.getZd().getTypename().endsWith("办事处")||dlyh.getZd().getTypename().endsWith("局")||dlyh.getZd().getTypename().endsWith("社")||dlyh.getZd().getTypename().endsWith("集团")||dlyh.getZd().getTypename().endsWith("院")||dlyh.getZd().getTypename().equals("民航"))){
   %>
  <input type="hidden" value="<%=request.getSession().getAttribute("shiqyid") %>" id="shiqyid" name="shiqyid" />
  <%}%>
  <input type="hidden" value="<%=dlyh.getZd().getParentid() %>" id="qyid" name="qyid" />
  <input type="hidden" value="<%=dlyh.getZd().getTypename() %>:<%=dlyh.getZd().getId() %>:<%=dlyh.getZd().getParentid() %>" id="dlyhzd" name="dlyhzd" />
  <input type="hidden" value="<%=request.getAttribute("shi") %>" id="shiid" name="shiid" />
  <input type="hidden" value="<%=request.getAttribute("xian") %>" id="xianid" name="xianid" />
  <input type="hidden" value="<%=request.getAttribute("xiang") %>" id="xiangid" name="xiangid" />
  <input type="hidden" value="<%=request.getAttribute("cun")%>" id="cunid" name="cunid" />
  <input type="hidden" value="<%=request.getAttribute("xianzhi") %>" id="xianzhi" name="xianzhi" />
  <script language="javascript" type="text/javascript" src="js/qy1.js"></script>
<form id="form1" name="form1" method="post" action="zdyryqk.do"  onsubmit="return yz();self.parent.tb_remove();">
  <p>
    <input type="hidden" value="" name="falg" id="falg"/>
    <input type="hidden" value="<%=request.getParameter("sname") %>" name="sname" id="sname"  >
    <%if((dlyh.getZd().getTypename().endsWith("市")&&dlyh.getZd().getParentid().equals(745))||dlyh.getZd().getTypename().equals("河北省")) {%>
    <div style="display: none">
    请选择单位：
   <select disabled="disabled" id="sheng" name="sheng" >
           <option value="河北省">河北省</option>
        </select>市
        <select id="shi" name="shi" onchange="shichange(this.value)">
           <option>请选择市</option>
           <%List xianlist=(List) request.getSession().getAttribute("shilist"); 
            for(int i=0;i<xianlist.size();i++){%>
           <option value="<%=((Zd)xianlist.get(i)).getId() %>"><%=((Zd)xianlist.get(i)).getTypename() %></option>
           <%} %>
        </select>市
        <select id="xian" name="xian" onchange="xianchange(this.value)">
           <option>请选择县</option>
        </select>县
        <select id="xiang"  name="xiang" onchange="xiangchange(this.value)" >
         <option >请选择乡</option>
        </select>乡
        <select id="cun"  name="cun" >
        <option >请选择村</option>
        </select>村<br />
        </div>
  <%} else{%>
   请选择单位：
   <select disabled="disabled" id="sheng" name="sheng" >
           <option value="河北省">河北省</option>
        </select>市
        <select id="shi" name="shi" onchange="shichange(this.value)">
           <option>请选择市</option>
           <%List xianlist=(List) request.getSession().getAttribute("shilist"); 
            for(int i=0;i<xianlist.size();i++){%>
           <option value="<%=((Zd)xianlist.get(i)).getId() %>"><%=((Zd)xianlist.get(i)).getTypename() %></option>
           <%} %>
        </select>市
        <select id="xian" name="xian" onchange="xianchange(this.value)">
           <option>请选择县</option>
        </select>县
        <select id="xiang"  name="xiang" onchange="xiangchange(this.value)" >
         <option >请选择乡</option>
        </select>乡
        <select id="cun"  name="cun" >
        <option >请选择村</option>
        </select>村<br />
  <%} %>
 　起始年龄：
  <input name="startNl" type="text"  class="SmallInput" id="startNl" size="5" maxlength="3" onchange="yznl(1)"/>
  <br />
    　终止年龄：
    <input name="endNl" type="text"  class="SmallInput" id="endNl" size="5" maxlength="3" onchange="yznl(2)"/>
    <br />
  　年龄间隔：
  <input name="nljg" type="text"  class="SmallInput" id="nljg" size="5" maxlength="3"  onchange="yznl(3)"/>
  </p>
  <p>
    <input type="submit" name="button" id="button" value="查看统计表"  onclick="document.getElementById('falg').value='';"/>
    <input type="submit" name="button2" id="button2" value="查看统计图"  onclick="document.getElementById('falg').value=1;"/>
    <input type="hidden" id ="bmbh" name="bmbh"  />
      </p>
</form>
</body>
</html>